/**
 * 历史版本信息 引用JS文件
 */

//初始化页面加载
$(function(){
	pageList();
});

function pageList(){

	$.ajax({
		url : "../self/scoreInfo",
		type : "post",
		dataType : "json",
		data : {"uniqueCode":uniqueCode},
		success : function(data){

			if(data == null || data == -1){
				$("#is_null").html('<div class="mui-card" style=""><div class="mui-card-footer"><p class="index-status" style="text-align:center; width:100%;margin-top:3%;">暂无信息</p></center></div>');
				return;
			}
			
			$("#sp_name").html(data.score.PERSON_LIABLE_NAME);
			$("#sp_time").html(okrTime(data.score.O_YEAR,data.score.O_QUARTER,data.score.O_MONTH));
			$("#sp_org").html("所属部门："+data.score.OWNER_DEPTNAME);
			$("#sp_tb_time").html("填报日期："+getTime(data.score.FILLING_TIME));
			$("#sp_pj_name").html("评价人："+data.score.EVALUATE_PERSON_NAME);
			$("#sp_pj_time").html("评价日期："+getTime(data.score.SUMMARIZE_REVIEW_TIME));
			$("#sp_href").html(data.score.REPORT_FILE_NAME);		
			$("#sp_href").attr("href","download/"+data.score.O_SCORE_REPORT_UUID);		
			$("#sp_state").html(sState(data.score.SCORE_STATE));		
			$("#sp_content").html(data.score.SUPERIOR_EVALUATE);	
			
			if(data.scores.length == 0){
				$("#list").html('<div class="mui-card" style=""><div class="mui-card-footer"><p class="index-status" style="text-align:center; width:100%;margin-top:3%;">暂无信息</p></center></div>');
				return;
			}
			
			$("#list").html("");
			var str = "";  
			$.each(data.scores,function(n,value) {
				str += '<div class="mui-card" style="">';
				str += '<div class="mui-card-header">';
				str += '<b>'+value.O_CODE+'</b> <a href="scored?uniqueCode='+value.O_UNIQUE_ID_CODE+'"><span class="index-dlink">KR评分</span></a>';
				str += '</div><div class="mui-card-content">';
				str += '<div class="mui-card-content-inner">';
				str += '<p class="re-bold"><span>定义：</span>'+value.O_DEFINITION+'&nbsp;&nbsp;</p>';
				str += '</div>';
				str += '<div class="mui-card-footer" style="padding-left: 0;">';
				str += '<table>';
				str += '<tr style="padding-bottom: 15px;">';
				str += '<td class="cblue you_center" width="25%">自评<br>';
				str += '（'+oColor(value.O_SCORE_ONESELF)+'）';
				str += '</td><td>自评说明：'+value.O_SCORE_EXPLAIN_ONESELF+'</td></tr>';
				str += '<tr style="height: 20px; border-bottom: solid thin #eee;">';
				str += '<td>&nbsp;</td>';
				str += '<td>&nbsp;</td>';
				str += '<tr>';
				str += '<tr style="height: 20px;">';
				str += '<td>&nbsp;</td>';
				str += '<td>&nbsp;</td>';
				str += '<tr>';
				str += '<tr>';
				str += '<td class="cblue you_center">上级评<br>';
				str += '（'+oColor(value.O_SCORE_SUPERIOR)+'）';
				str += '</td>';
				str += '<td>上级评说明：'+value.O_SCORE_EXPLAIN_SUPERIOR+'</td>';
				str += '</tr>';
				str += '</table>';
				str += '</div>';
				str += '</div>';
				str += '</div>';
			});  
			$("#list").html(str);
		}
	});
}